package com.base.component.ai.system.service.impl;

import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.base.component.ai.system.dao.AgentConfigureDao;
import com.base.component.ai.system.entity.AgentConfigureDO;
import com.base.component.ai.system.service.AgentConfigureService;
import com.base.core.framework.sql.service.impl.SqlBaseServiceImplV1Ext;


/**
 * @author zywei 
 * @date 2025-01-08 22:10:14
 */
@Service("agentConfigureService")
public class AgentConfigureServiceImpl extends SqlBaseServiceImplV1Ext<AgentConfigureDO,Long> 
implements AgentConfigureService {

	final AgentConfigureDao agentConfigureDao;
	
	public AgentConfigureServiceImpl(@Qualifier("agentConfigureDao")AgentConfigureDao agentConfigureDao) {
		super(agentConfigureDao);
		this.agentConfigureDao=agentConfigureDao;
	}

	@Override
	public SortedMap<Integer,List<AgentConfigureDO>> query(String code) {
		List<AgentConfigureDO> result=queryForList("code", code);
		return new TreeMap<>(result.stream().collect(Collectors.groupingBy(AgentConfigureDO::getGroupId)));
	}

}
